"""
专家视图
"""
from flask import Blueprint, request
from service.UserService import userService

bp = Blueprint("ExpertSubSys", __name__, url_prefix="/ExpertSubSys")


@bp.route('/')
def index():
    return {
        "stuatus": 'ok'
    }


# 专家列表
@bp.route('/ExpertList')
def expertlist():
    userservice = userService()
    ds = userservice.expertlist()
    dict = {}
    dict['result'] = ds
    return dict


# 搜索专家
@bp.route('/Search')
def search():
    # 获得搜索框的内容
    str = request.args.get('str')
    userservice = userService()
    ds = userservice.search(str)
    dict = {}
    dict['result'] = ds
    return dict


#专家详情
@bp.route('/FindById')
def findbyid():
    # 获得搜索框的内容
    eid = request.args.get('id')
    userservice = userService()
    ds = userservice.findbyid(eid)
    dict = {}
    dict['result'] = ds
    return dict
